<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <button @click='toggle'>显示隐藏</button>
        <transition name="fade">
            <div v-if="show">123456</div>
        </transition>
    </div>
</body>

<script src="./node_modules/vue/dist/vue.js"></script>
<!-- 可适用异步 -->
<script>
    new Vue({
        el: '#app',
        data: () => {
            return {
                show: true
            } 
        },
        methods: {
            toggle(){
                this.show=!this.show
            }
        }
    })
</script>


</html>